<?php
namespace jy_farmer;
defined('BY_JYA') or exit('error');
/*
	员工
*/
class worker extends \plugin{
	//工作记录
	public function uplog($params=array(),$workerid=0){
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$isadd=pdo_getcolumn('jy_farmer_worker_log',array('createtime >'=>$daytime,'pid'=>intval($params['pid']),'totype'=>$params['totype'],'type'=>$params['type'],'uniacid'=>$_SESSION['uniacid']),'id');
		if($isadd){
			exi('今天已['.$params['msg'].'],无需再操作！','error');
		}
		$data=array(
			'uniacid'=>$_SESSION['uniacid'],
			'order_id'=>$params['order_id'],
			'pid'=>intval($params['pid']),
			'totype'=>$params['totype'],
			'msg'=>$params['msg'],
			'type'=>$params['type'],
			'status'=>$params['status'],
			'workerid'=>$workerid,
			'createtime'=>TIMESTAMP,
		);
		$this->insert('worker_log',$data);
	}
}